package com.arpa.wms.mapper;
import com.arpa.wms.domain.dto.ReceiveDTO;
import com.arpa.wms.domain.entity.Receive;
import com.arpa.wms.domain.vo.ReceiveVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 收货 Mapper 接口
 * </p>
 *
 * @author LEO
 * @since 2020-08-04
 */
public interface ReceiveMapper extends BaseMapper<Receive> {

    /**
     * 查询列表
     * @param receiveDTO
     * @return
     */
    List<ReceiveVO> queryList(ReceiveDTO receiveDTO);

    /**
     * 查询合计,包含总数
     * @param sql
     * @return
     */
    ReceiveVO queryListSum(@Param("sql") String sql);

    /**
     * 查询合计,包含总数
     * @param receiveDTO
     * @return
     */
    ReceiveVO queryListTotal(ReceiveDTO receiveDTO);

    /**
     * insert data
     * @param sql
     * @return
     */
    int insertDataBySql(@Param("sql") String sql);

    /**
     * 根据code获取一条数据
     * @param code
     * @return
     */
    Receive getOneByCode(@Param("code")String code, @Param("groupCode") String groupCode);

    /**
     * 调整收货单位下发状态
     * @param code
     */
    void issue(@Param("code") String code, @Param("groupCode") String groupCode);

    /**
     * 统计收货明细单上架数量，更新指定收货单的上架数量
     * @param code
     */
    void refreshPutawayQuantity(@Param("code") String code, @Param("groupCode") String groupCode);

    /**
     * 统计收货明细单上架数量，更新指定收货单的上架和入库数量
     * @param code
     */
    void refreshPutawayAndInboundQuantity(@Param("code") String code, @Param("groupCode") String groupCode);
}
